<?php 
include ("../class/localtion.php");
$clslocal = new localtionpz();
$dataview = $clslocal->viewlocaltion();
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>

<table>
<tr>
<td>No.</td>
<td>Localtion</td>
<td>Project</td>
<td>Edit</td>
<td>Delete</td>
<td>View</td>
</tr>

<?php 
$i = 0;
while($row = $clslocal->mysqlfetcharray($dataview)) { $i++  ?>
<tr>
<td><?php print $i ?></td>
<td><?php print $row['name_local']?></td>
<td><?php print $row['project']?></td>
<td><a href="JavaScript:if(confirm('คุณต้องการแก้ไขข้อมูลนี้หรือไม่')==true){window.location = 'edit_local.php?idedit_local=<?php print $row['id_local']?>';}">Edit</a></td>
<td><a href="JavaScript:if(confirm('คุณต้องการลบข้อมูลนี้หรือไม่')==true){window.location = 'del_local.php?iddel_local=<?php print $row['id_local']?>';}">Delete</a></td>
<td><a href="viewed.php?idview_local=<?php print $row['id_local']?>">View</a></td>
</tr>
<?php } ?>

</table>
</body>
</html>